#include "affichageopengl.h"

AffichageOpenGL::AffichageOpenGL(QWidget *parent): myGLWidget(60, parent)
{

}


void AffichageOpenGL::initializeGL()
{

    //active le Z-Buffer
    glEnable(GL_DEPTH_TEST);
    //glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
}

void AffichageOpenGL::resizeGL(int width, int height)
{
    glViewport(0,0,width,height);
}

void AffichageOpenGL::paintGL()
{
    //on clear et on reinitialise le Z-Buffer
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) ;

    //construction de la matrice
    QMatrix4x4 projection;
    projection.perspective(70.0, 1.0 * width() / height(), 0.1, 10000.0);
}
